]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Don't proxy methods through overview; add a getWorkspacesForWindow()
authorColin Walters <walters@verbum.org>
Fri, 11 Sep 2009 16:47:53 +0000 (12:47 -0400)
committerColin Walters <walters@verbum.org>
Mon, 14 Sep 2009 19:41:12 +0000 (15:41 -0400)
Duplicating the methods was unnecessary.  Also, we want a getWorkspacesForWindow()
method as preparation for multi-monitor work.

https://bugzilla.gnome.org/show_bug.cgi?id=594699

js/ui/appDisplay.js
js/ui/overview.js
js/ui/workspaces.js

index 9caf83475e492c9a61f8a31fc7181969ef60bc6b..9c20e5cbd224bf132e99f7e0fc09cfbe051a996b 100644 (file)
@@ -848,8 +848,8 @@ RunningWellItem.prototype = {
 
         if (this._menu == null) {
             this._menu = new WellMenu(this);
-            this._menu.connect('highlight-window', Lang.bind(this, function (menu, window) {
-                Main.overview.setHighlightWindow(window);
+            this._menu.connect('highlight-window', Lang.bind(this, function (menu, metaWindow) {
+                Main.overview.getWorkspacesForWindow(metaWindow).setHighlightWindow(metaWindow);
             }));
             this._menu.connect('popup', Lang.bind(this, function (menu, isPoppedUp) {
                 let id;
@@ -858,7 +858,8 @@ RunningWellItem.prototype = {
                     id = this.appInfo.get_id();
                 else
                     id = null;
-                Main.overview.setApplicationWindowSelection(id);
+
+                Main.overview.getWorkspacesForWindow(null).setApplicationWindowSelection(id);
             }));
         }
 
index 326a86aed8885f440b5969af8c259a57424004b5..c8d2729932d409f9bcd79df415aadf5fee606176 100644 (file)
@@ -386,6 +386,18 @@ Overview.prototype = {
             this.show();
     },
 
+    /**
+     * getWorkspacesForWindow:
+     * @metaWindow: A #MetaWindow
+     *
+     * Returns the Workspaces object associated with the given window.
+     * This method is not be accessible if the overview is not open
+     * and will return %null.
+     */
+    getWorkspacesForWindow: function(metaWindow) {
+        return this._workspaces;
+    },
+
     /**
      * activateWindow:
      * @metaWindow: A #MetaWindow
@@ -401,31 +413,6 @@ Overview.prototype = {
          this.hide();
     },
 
-    /**
-     * setHighlightWindow:
-     * @metaWindow: A #MetaWindow
-     *
-     * Draw the user's attention to the given window @metaWindow.
-     */
-    setHighlightWindow: function (metaWindow) {
-        if (this._workspaces)
-            this._workspaces.setHighlightWindow(metaWindow);
-    },
-
-
-    /**
-     * setApplicationWindowSelection:
-     * @appid: Application identifier string
-     *
-     * Enter a mode which shows only the windows owned by the
-     * given application, and allow highlighting of a specific
-     * window with setHighlightWindow().
-     */
-    setApplicationWindowSelection: function (appid) {
-        if (this._workspaces)
-            this._workspaces.setApplicationWindowSelection(appid);
-    },
-
     //// Private methods ////
 
     _showDone: function() {
index 3fcb6019e21dd68ee751a429f44497128863744a..d36366bfbfe1897985a6403e0dd5e96f378663c4 100644 (file)
@@ -544,6 +544,13 @@ Workspace.prototype = {
         return -1;
     },
 
+    /**
+     * lookupCloneForMetaWindow:
+     * @metaWindow: A #MetaWindow
+     *
+     * Given a #MetaWindow instance, find the WindowClone object
+     * which represents it in the workspaces display.
+     */
     lookupCloneForMetaWindow: function (metaWindow) {
         let index = this._lookupIndex (metaWindow);
         return index < 0 ? null : this._windows[index];
@@ -573,6 +580,12 @@ Workspace.prototype = {
         }
     },
 
+    /**
+     * setHighlightWindow:
+     * @metaWindow: A #MetaWindow
+     *
+     * Draw the user's attention to the given window @metaWindow.
+     */
     setHighlightWindow: function (metaWindow) {
         for (let i = 0; i < this._windows.length; i++) {
             this._windows[i].actor.lower(this._lightbox);
@@ -1157,7 +1170,14 @@ Workspaces.prototype = {
         }
     },
 
-    // See comments in overview.js
+    /**
+     * setApplicationWindowSelection:
+     * @appid: Application identifier string
+     *
+     * Enter a mode which shows only the windows owned by the
+     * given application, and allow highlighting of a specific
+     * window with setHighlightWindow().
+     */
     setApplicationWindowSelection: function (appId) {
         let appSys = Shell.AppMonitor.get_default();